<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/includes/common.jsp" %>

<table>
    <c:forEach items="${action.dishes}" var="dish">
    <tr>
    
        <td>
        	<c:choose>
        	<c:when test="${empty dish.name}">
            	<a href="view?id=${dish.id}&edit=${param.edit}">${dish.id}</a>
        	</c:when>
        	<c:otherwise>
            	<a href="view?id=${dish.id}&edit=${param.edit}">${dish.name}</a>
        	</c:otherwise>
            </c:choose>
        </td>
        <c:if test="${param.edit!=false || empty param.edit}">
        <td class="action-link list-item-action">
            <a href="edit?id=${dish.id}">Sửa</a>
            .
            <a href="delete?id=${dish.id}">Xoá</a>
        </td>
        </c:if>
    </tr>
    </c:forEach>
    <tr>
        <td colspan="3" class="action">
            <c:if test="${param.edit!=false || empty param.edit}"><a href="add">Thêm mới</a></c:if>
        </td>
    </tr>
</table>
